package org.zhenggn.designpattern.chain;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created by zhenggn on 2017/5/3.
 */
public class Client1 {
    public static void main(String[] args) {

        ExecutorService executorService = Executors.newCachedThreadPool();

        for(int i=0;i<500;i++) {
            executorService.execute(new Runnable() {
                @Override
                public void run() {
                    System.out.println("============"+Thread.currentThread().getName()+"========================= start");




                    GoodsSaleEbo goodsSaleEbo = new GoodsSaleEbo();
                    SaleModel saleModel = new SaleModel();

                    saleModel.setGoods("张学友怀旧经典");
                    saleModel.setSaleNum(100);

                    goodsSaleEbo.sale("小李","张三",saleModel,new User());
                    goodsSaleEbo.sale("小张","李四",saleModel,new User());
                    System.out.println("============"+Thread.currentThread().getName()+"========================= end");
                }
            });


        }

    }




}
